package jykim;

public class ThreeSixNine {

	private int number;
	private String temp;
	
	public ThreeSixNine(){
		this(30);
	}
	
	public ThreeSixNine(int n){
		this.number = n;
	}
	
	public void make(){
		
		for (int i = 1; i <= number; i++) {
			temp = Integer.toString(i);
			if (temp.indexOf("3")!=-1 || temp.indexOf("6")!=-1 || temp.indexOf("9")!=-1) {
				temp = temp.replace("3", "*");
				temp = temp.replace("6", "*");
				temp = temp.replace("9", "*");
				
				for (int j = 0; j < 10; j++) {
					temp = temp.replace(Integer.toString(j), "");
				}
			}
			System.out.print(temp +"\t");
			
			if(i%10==0){
				System.out.println();
			}
		}
	}
}
